public class TestStudent {
    public String name;
    public int age;
    public int washOrBath;

    //构造方法
    public TestStudent() {
        this(10, "常威");//必须在构造方法里的第一行
        System.out.println("这是一个构造方法");
    }
    public TestStudent(int age, String name) {
        System.out.println("这也是一个构造方法");
    }

    public void wash() {
        System.out.println("洗漱");
    }
    public void sleep() {
        this.wash();
        System.out.println("睡觉");
    }

    public static void main1(String[] args) {
        TestStudent student = new TestStudent();
        student.name = "二狗";
        student.age = 10;
        System.out.println(student.name + " " + student.age);

        student.washOrBath = 1;
        student.sleep();
    }
    public static void main(String[] args) {
        TestStudent student = new TestStudent();

    }
}
